package com.jk.controller;

import com.jk.entity.User;
import com.jk.service.HelloService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by dell on 2017/6/16.
 */
@RestController
public class HelloController {

    @Resource
    private HelloService helloService;

    @RequestMapping("hello")
    public Map<String, String> hello() {
        HashMap<String, String> map = new HashMap<>();
        map.put("name", "卢子豪");
        return map;
    }

    @RequestMapping("helloData")
    public Map<String, List<User>> helloData() {
        List<User> list = helloService.selectUserList();
        HashMap<String, List<User>> map = new HashMap<>();
        map.put("name", list);
        return map;
    }
}
